stylecontext: Remove excess gtk_css_node_invalidate() call
authorBenjamin Otte <otte@redhat.com>
Tue, 21 Jan 2020 13:43:31 +0000 (14:43 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 21 Jan 2020 13:49:25 +0000 (14:49 +0100)
This call is not necessary, because gtk_css_node_set_parent() does the
right thing. (It probably hasn't been necessary for years, but I'm
not gonna try my luck on GTK3 at this stage.)

This code is usually called the first time
gtk_widget_get_style_context() is called on a widget and its style
context gets create. At that point however, the css nodes are in the
right place already, so no invalidation should happen.

gtk/gtkstylecontext.c

index 7e7deabb9af343db76b1e75b26220ab604f71efb..717dce8437f0ce9d11794f8959da11c51e895e31 100644 (file)
@@ -1035,7 +1035,6 @@ gtk_style_context_set_parent (GtkStyleContext *context,
   priv->parent = parent;
 
   g_object_notify_by_pspec (G_OBJECT (context), properties[PROP_PARENT]);
-  gtk_css_node_invalidate (gtk_style_context_get_root (context), GTK_CSS_CHANGE_ANY_PARENT | GTK_CSS_CHANGE_ANY_SIBLING);
 }
 
 /**